Skip to main content

Delete Comment

DELETE /post/comment/:commentId​

Description​

Soft-deletes a comment. A user can delete their own comment, or the post owner can delete it when the post owner's account is private.

Request Parameters​

Requires Authentication: true​

PATH PARAMS​

NameTypeRequiredDescription
commentIdstringYesMongoDB comment ID.

Success Response​

{
"message": "Comment deleted successfully",
"post": {
"_id": "66cbbea31e854f3d7995c1f0"
},
"comment": {
"_id": "66ef265c8f073b81cb3b3900",
"status": "deleted"
}
}

Error Response​

CodeDescription
403Not allowed to delete this comment
404Comment or post not found
401Missing or invalid access token
500Server error